#pragma once
#include <cmath>

class PWM
{
public:
    double frequency, amptitude;
    double cycle;
    double *simulation_time, inner_time;

    void set(double f, double a, double *simulation_time)
    {
        frequency = f;
        amptitude = a;
        cycle = 1 / frequency;
        this->simulation_time = simulation_time;
    }

    PWM(){};

    double generate_triangle_wave();

    double carrier;

    int compare(double modulation_wave);
};